﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using HengTong.Model._Admin;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using HengTong.Model.Db;
using HengTong.Model.Db.System;


namespace HengTong.ViewModel.Wechat.SysWechatUserVms
{
    public partial class SysWechatUserTemplateVm : BaseTemplateVM
    {
        [Display(Name = "网站OpenId")]
        public ExcelPropety WebOpenIdExcel = ExcelPropety.CreateProperty<SysWechatUser>(x => x.WebOpenId);
        [Display(Name = "公众号OpenId")]
        public ExcelPropety MpOpenIdExcel = ExcelPropety.CreateProperty<SysWechatUser>(x => x.MpOpenId);
        [Display(Name = "小程序OpenId")]
        public ExcelPropety MiniProgramOpenIdExcel = ExcelPropety.CreateProperty<SysWechatUser>(x => x.MiniProgramOpenId);
        [Display(Name = "UnionId")]
        public ExcelPropety UnionIdExcel = ExcelPropety.CreateProperty<SysWechatUser>(x => x.UnionId);
        [Display(Name = "昵称")]
        public ExcelPropety NickNameExcel = ExcelPropety.CreateProperty<SysWechatUser>(x => x.NickName);
        [Display(Name = "头像")]
        public ExcelPropety HeadImgUrlExcel = ExcelPropety.CreateProperty<SysWechatUser>(x => x.HeadImgUrl);
        [Display(Name = "绑定用户")]
        public ExcelPropety UserExcel = ExcelPropety.CreateProperty<SysWechatUser>(x => x.UserId);

	    protected override void InitVM()
        {
            UserExcel.DataType = ColumnDataType.ComboBox;
            UserExcel.ListItems = DC.Set<FrameworkUser>().GetSelectListItems(Wtm, y => y.Name);
        }

    }

    public class SysWechatUserImportVm : BaseImportVM<SysWechatUserTemplateVm, SysWechatUser>
    {

    }

}
